<?php
include_once("header.php");
?>
<?php
$email=$_GET["id"];
if(empty($email)){echo "<h3>Invalid user</h3>"; include_once("footer.php"); die();}
?>
<h3>Change password <br> user: <?php echo "$email"; ?></h3>

<?php
if($_POST["action"] == 1)
{
	$email=$_POST["email"];
	$password=$_POST["password"];
	$password_1=$_POST["password_1"];
	if($password != $password_1){echo "<h4>Password does not match. Please try again</h4>"; include_once("user/form_change_pass.php");}
	else {
		$updatePass=mysql_query("UPDATE users set password=ENCRYPT('$password') WHERE email='$email'");
		$nUpdate=mysql_affected_rows();
		if($nUpdate == 1){echo "<hr><h3>Password changed successfully!</h3><hr>";}
	}
}
else
{
//include form
include_once("user/form_change_pass.php");
}
?>
<br /><br />
<br /><br />
<?php
include_once("footer.php");
?>
